<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let s = "www.jb51.ITCASE.CN";
        console.log("原字符串为："+s);
        function toLowerCase(s){ 
            let t = ''; 
            for(let i = 0;i < s.length;++i){
                let c = s.charCodeAt(i);
                if(c >= 65 && c <= 90) c += 32;
                c = String.fromCharCode(c);
                t += c;
            }
            return t;
        }
        function toUpperCase(s){
            let t = ''; 
            for(let i = 0;i < s.length;++i){ 
                let c = s.charCodeAt(i);
                if(c >= 97 && c <= 122) c -= 32;
                c = String.fromCharCode(c);
                t += c;
            }
            return t;
        }
        console.log("转小写符串为："+toLowerCase(s));
        console.log("转大写字符串为："+toUpperCase(s));
    </script>
</body>
</html>